package com.ylr.自定义枚举类校验;

import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List;


/**
 * @Classname User
 * @Description TODO
 * @Date 2021/8/12 14:22
 * @Created by ylr
 */

@Data
@Valid
public class User {
    @NotBlank
    private String name;
    @NotNull
    private Integer age;
//    @EnumValueValidation(enumClass = SexEnum.class,enumMethod = "isValid")
    private String sex;

    @EnumValueValidation(enumClass = SexEnum.class,isList = true,enumMethod = "isValid")
    private List<String> sexs;

    @Valid
    private List<User> son;
}
